package com.majsubtense.core.achievements;

interface CountGenerator {
    int generate();
}

public abstract class CountTriggeredAchievement extends Achievement {
    public static final AchievementType<CountTriggeredAchievement> ANY;
    protected int count = 0;
    protected String[] triggeredMessages;
    protected CountGenerator countGenerator;

    public CountTriggeredAchievement(AchievementType<? extends Achievement> achievementType, String achievementMessage) {
        super(achievementType, achievementMessage);
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public String getCurrentMessage() {
        return triggeredMessages[count - 1];
    }

    public String[] getTriggeredMessages() {
        return triggeredMessages;
    }

    public void setTriggeredMessages(String[] triggeredMessages) {
        this.triggeredMessages = triggeredMessages;
    }

    public CountGenerator getCountGenerator() {
        return countGenerator;
    }

    public void setCountGenerator(CountGenerator countGenerator) {
        this.countGenerator = countGenerator;
    }

    static {
        ANY = new AchievementType<>(AchievementType.ROOT, "COUNT_TRIGGERED");
    }
}
